<template>
  <div>
    <!-- 标题 -->
    <div class="title">
      <img src="../../../assets/images/tool.png" alt="" />
      <span>企业基本信息</span>
    </div>

    <!-- 内容 -->
    <div class="dataList">
      <el-form ref="form" :model="form" label-width="auto">
        <el-form-item label="企业名称" prop="entName">
          <el-input v-model="form.entName"></el-input>
        </el-form-item>

        <el-row>
          <el-col :span="12">
            <el-form-item label="企业编码" prop="entCode">
              <el-input v-model="form.entCode"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="统一社会信用代码" prop="entUscc">
              <el-input v-model="form.entUscc"></el-input>
            </el-form-item>
          </el-col>
        </el-row>

        <!-- 城市选择 -->
        <el-row>
          <el-col :span="10">
            <el-form-item label="行政区域" required>
              <el-cascader
                size="medium"
                :options="options"
                v-model="selectedOptions"
                ref="cascaderAddr"
                @change="handleChange"
              >
              </el-cascader>
            </el-form-item>
          </el-col>
          <el-col :span="7">
            <el-form-item
              label="镇或街道"
              prop="entTown"
              label-width="140px"
              required
            >
              <el-input v-model="form.entTown"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="7">
            <el-form-item
              label="村或社区"
              prop="entVillage"
              label-width="140px"
              required
            >
              <el-input v-model="form.entVillage"></el-input>
            </el-form-item>
          </el-col>
        </el-row>
        <!-- 行政 -->
        <el-row>
          <el-col :span="10">
            <el-form-item label="行政区划" prop="entDistrict" required>
              <el-input v-model="form.entDistrict"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="14">
            <el-form-item
              label="所在县（市、区）行政区域编码"
              prop="entCountryCode"
              required
            >
              <el-input v-model="form.entCountryCode"></el-input>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="所在乡镇（街道）行政 区域编码">
              <el-input v-model="form.entTownCode"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="所在村（社区）行政区 域编码">
              <el-input v-model="form.entVillageCode"></el-input>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="工商注册地址" prop="entRegAddr" required>
              <el-input v-model="form.entRegAddr"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="生产经营地址" prop="entProdAddr" required>
              <el-input v-model="form.entProdAddr"></el-input>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="邮政编码" prop="entPostalCode" required>
              <el-input v-model="form.entPostalCode"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="成立日期" required>
              <el-date-picker
                v-model="form.entFoundDate"
                type="date"
                placeholder="选择日期时间"
                value-format="yyyy-MM-dd"
                style="width: 100%"
              >
              </el-date-picker>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="安全值班电话" prop="entSafetyDutyTel" required>
              <el-input v-model="form.entSafetyDutyTel"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="企业联系电话" prop="entFixPhone" required>
              <el-input v-model="form.entFixPhone"></el-input>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="是否为国有企业">
              <el-radio-group v-model="form.entIsStateEnt" @change="radioE">
                <el-radio label="是"></el-radio>
                <el-radio label="否"></el-radio>
              </el-radio-group>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="电子邮箱" prop="entEmail" required>
              <el-input v-model="form.entEmail"></el-input>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="注册资金（万元）" prop="entRegFund" required>
              <el-input v-model="form.entRegFund"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item
              label="经营状态"
              style="width: 100%"
            >
              <el-select
                v-model="form.entBusinessStatus"
                placeholder="请选择"
                @change="entBS"
              >
                <el-option label="在业" value="在业"></el-option>
                <el-option label="停业" value="停业"></el-option>
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item
              label="是否有母公司"             
            >
              <el-radio-group
                v-model="form.entHasParentCompany"
                @change="entHP"
              >
                <el-radio label="是"></el-radio>
                <el-radio label="否"></el-radio>
              </el-radio-group>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="集团公司名称" prop="entGroupName" required>
              <el-input v-model="form.entGroupName"></el-input>
            </el-form-item>
          </el-col>
        </el-row>
        <!-- <el-row>
          <el-col :span="12"> -->
            <el-form-item
              label="企业隶属关系"
            >
              <el-select
                v-model="form.entBusinessSubordination"
                placeholder="请选择"
                @change="entBSu"
                style="width: 100%"
              >
                <el-option
                  v-for="item in entBusiness"
                  :key="item.id"
                  :label="item.dictValueName"
                  :value="item.dictValueName"
                  
                ></el-option>
              </el-select>
            </el-form-item>
          <!-- </el-col> -->
          <!-- <el-col :span="12">
            <el-form-item label="隶属关系" prop="entSubordination" required>
              <el-input v-model="form.entSubordination"></el-input>
            </el-form-item>
          </el-col> -->
        <!-- </el-row> -->
        <!-- 上传 -->
        <!-- <el-form-item label="企业照片" required> -->
        <!-- <el-upload
                action="/api/resource/file/upload"
                list-type="picture-card"
                :on-preview="handlePictureCardPreview"
                :on-remove="handleRemove">
                <img src="../../../assets/images/uploadImg/uploadOne.png" alt="">
              </el-upload> -->
        <!-- <el-upload
                ref='upload'
                :action="'/resource/file/upload'"
                list-type="picture-card"
                accept="image/*"
                :limit="imgLimit"
                :file-list="productImgs"
                :on-preview="handlePictureCardPreview"
                :on-remove="handleRemove"
                :on-success="handleAvatarSuccess"
                :before-upload="beforeAvatarUpload"
                :on-exceed="handleExceed"
                :on-error="imgUploadError"
                :on-change="handleEditChange"
                :class="{hide:hideUploadEdit}">
                <img src="../../../assets/images/uploadImg/uploadOne.png" alt="">
              </el-upload> -->

        <!-- <upload-data @setCardPic="setCardPic($event,'imgpath')" ref="imgpath"></upload-data> -->

        <!-- <el-dialog :visible.sync="dialogVisible">
                <img width="100%" :src="dialogImageUrl" alt="">
              </el-dialog>
        </el-form-item> -->
        <el-form-item label="企业照片">
          <el-upload
            class="avatar-uploader"
            :file-list="bgPic2"
            list-type="picture-card"
            :limit="imgLimit"
            :on-exceed="handleExceed"
            :http-request="
              (params) => {
                handleUploadPreview(params, 'bgPic2');
              }
            "
          >
            <img src="../../../assets/images/uploadImg/uploadOne.png" alt="" />
            <div slot="file" slot-scope="{ file }">
              <img :src="imgSrc" class="avatar" />
              <span class="el-upload-list__item-actions">
                <span
                  class="el-upload-list__item-delete"
                  @click="handleRemove(file, 'bgPic2')"
                >
                  <i class="el-icon-delete"></i>
                </span>
              </span>
            </div>
          </el-upload>
        </el-form-item>

        <el-row>
          <el-col :span="12">
            <el-form-item label="经济类型大类">
              <el-select
                v-model="form.entEconomyTypeB"
                placeholder="请选择"
                style="width: 100%"
                @change="entET"
              >
                <el-option label="内资" value="内资"></el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="经济类型小类">
              <el-select
                v-model="form.entEconomyTypeS"
                placeholder="请选择"
                style="width: 100%"
                @change="entETy"
              >
                <el-option label="国有全资" value="国有全资"></el-option>
                <el-option label="集体全资" value="集体全资"></el-option>
                <el-option label="股份合作" value="股份合作"></el-option>
                <el-option label="联营" value="联营"></el-option>
                <el-option
                  label="有限责任(公司)"
                  value="有限责任(公司)"
                ></el-option>
                <el-option
                  label="其他有限责任(公司)"
                  value="其他有限责任(公司)"
                ></el-option>
                <el-option
                  label="股份有限(公司)"
                  value="股份有限(公司)"
                ></el-option>
                <el-option label="私有" value="私有"></el-option>
                <el-option label="个体工商户" value="个体工商户"></el-option>
                <el-option label="其他内资" value="其他内资"></el-option>
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
        <!-- <el-row> 
          <el-col :span="12">
            <el-form-item label="行业类别门类" required>
              <el-select v-model="form.entIndustryCategory" placeholder="请选择" style="width:100%">
                <el-option label="在业" value="shanghai"></el-option>
                <el-option label="停产" value="beijing"></el-option>
              </el-select>
            </el-form-item>
          </el-col> 
          <el-col :span="12">
            <el-form-item label="行业类别大类" required>
              <el-select v-model="form.entIndustryCategoryB" placeholder="请选择" style="width:100%">
                <el-option label="在业" value="shanghai"></el-option>
                <el-option label="停产" value="beijing"></el-option>
              </el-select>
            </el-form-item>
          </el-col>  
        </el-row>
        <el-row> 
          <el-col :span="12">
            <el-form-item label="行业类别中类" required>
              <el-select v-model="form.entIndustryCategoryM" placeholder="请选择" style="width:100%">
                <el-option label="在业" value="shanghai"></el-option>
                <el-option label="停产" value="beijing"></el-option>
              </el-select>
            </el-form-item>
          </el-col> 
          <el-col :span="12">
            <el-form-item label="行业类别小类" required>
              <el-select v-model="form.entIndustryCategoryS" placeholder="请选择" style="width:100%">
                <el-option label="在业" value="shanghai"></el-option>
                <el-option label="停产" value="beijing"></el-option>
              </el-select>
            </el-form-item>
          </el-col>  
        </el-row> -->
        <el-row>
          <el-col :span="12">
            <el-form-item
              label="行业监管大类"
            >
              <el-select
                v-model="form.entIndustryRegulaB"
                placeholder="请选择"
                style="width: 100%"
                @change="entIR"
              >
                <el-option
                  label="医药企业监管"
                  value="医药企业监管"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item
              label="行业监管小类"
            >
              <el-select
                v-model="form.entIndustryRegulaS"
                placeholder="请选择"
                style="width: 100%"
                @change="entIRS"
              >
                <el-option label="医药企业" value="医药企业"></el-option>
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="所属行业门类">
              <el-select
                v-model="form.IndustryCategory"
                placeholder="请选择"
                style="width: 100%"
                @change="ICa"
              >
                <el-option
                  label="农、林、牧、渔业"
                  value="农、林、牧、渔业"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="所属行业大类">
              <el-select
                v-model="form.IndustryTypeB"
                placeholder="请选择"
                style="width: 100%"
                @change="getitem"
              >
                <el-option label="农业" value="农业"></el-option>
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="所属行业中类">
              <el-select
                v-model="form.IndustryTypeM"
                placeholder="请选择"
                style="width: 100%"
                @change="ITy"
              >
                <el-option label="谷物种植" value="谷物种植"></el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="所属行业小类">
              <el-select
                v-model="form.IndustryTypeS"
                placeholder="请选择"
                style="width: 100%"
                @change="ITyS"
              >
                <el-option label="稻谷种植" value="稻谷种植"></el-option>
                <el-option label="小麦种植" value="小麦种植"></el-option>
                <el-option label="玉米种植" value="玉米种植"></el-option>
                <el-option
                  label="其他谷物种植"
                  value="其他谷物种植"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item
              label="安全生产许可证编号"
              prop="safetyProductionLicense"
              required
            >
              <el-input v-model="form.safetyProductionLicense"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item
              label="年销售收入（万元）"
              prop="annualSalesRevenue"
              required
            >
              <el-input v-model="form.annualSalesRevenue"></el-input>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item
              label="企业类型/领证类型"
            >
              <el-select
                v-model="form.businessType"
                placeholder="请选择"
                style="width: 100%"
                @change="bsT"
              >
                <el-option label="生产" value="生产"></el-option>
                <el-option label="经营" value="经营"></el-option>
                <el-option label="使用" value="使用"></el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item
              label="安全管理机构成员数量"
              prop="entSafeOrgEmpNum"
              required
            >
              <el-input v-model="form.entSafeOrgEmpNum"></el-input>
            </el-form-item>
          </el-col>
        </el-row>
        <el-form-item label="企业规模">
          <el-select
            v-model="form.entScale"
            placeholder="请选择"
            style="width: 100%"
            @change="eSca"
          >
            <el-option label="大型" value="大型"></el-option>
            <el-option label="中型" value="中型"></el-option>
            <el-option label="小型" value="小型"></el-option>
            <el-option label="微型" value="微型"></el-option>
          </el-select>
        </el-form-item>

        <el-form-item class="middle">
          <el-button type="primary" @click="onSubmit" plain>保存</el-button>
          <el-button type="primary" @click="nextTo">下一步</el-button>
        </el-form-item>
      </el-form>
    </div>
  </div>
</template>

<script>
import { regionData, CodeToText, TextToCode } from "element-china-area-data";
import { uploadAPI } from "@/api/system/common";
import { BASE_URL, IMG_URL } from "@/router/axios";
import { fastGetDictAPI } from "@/api/system/dictionary";
import { enterpriseAPI } from "@/api/editorPage/index";
export default {
  data() {
    return {
      imgUrl: IMG_URL,
      baseUrl: BASE_URL,
      imgpath: "",
      options: regionData,
      selectedOptions: [],
      value1: "",
      // 前面部分的地址
      frontAddress: "",
      // 后面的细节地址
      address: "",
      cityD: [],
      mtShopForm: {
        address: "",
      },
      // 上传的版块
      dialogVisible: false,
      productImgs: [],
      imgLimit: 1, //文件个数
      hideUploadEdit: false,
      uploadAction: "",
      bgPic2: [],
      imgSrc: "",
      dictionaryD: [],
      entBusiness: [],
      // 表单验证
      rules: {
        entName: [
          { required: true, message: "请输入企业名称", trigger: "blur" },
        ],
        entCode: [
          { required: true, message: "请输入企业编码", trigger: "blur" },
        ],
        entUscc: [
          {
            required: true,
            message: "请输入统一社会信用代码",
            trigger: "blur",
          },
        ],
      },
      objData: {},
      form:{
        entProvince: "", //省//后台必须有key值24
        entCity: "", //市 //后台必须有key值6
        entCountry: "", //区 //后台必须有key值8
        IndustryTypeB:{}, //后台必须有key值34
        entName: "", //后台必须有key值21
        entCode: "", //后台必须有key值7
        entUscc: "", //后台必须有key值30
        entDistrict: "", //后台必须有key值10
        entCountryCode: "", //后台必须有key值9
        entTownCode: "", //后台必须有key值29
        entTown: "", //后台必须有key值28
        entVillageCode: "", //后台必须有key值32
        entVillage: "", //后台必须有key值31
        entRegAddr: "", //后台必须有key值25
        entProdAddr: "", //后台必须有key值23
        entPostalCode: "", //后台必须有key值22
        entFoundDate: "null", //-- //后台必须有key值16
        entSafetyDutyTel: "", //后台必须有key值26
        entFixPhone: "", //后台必须有key值15
        entIsStateEnt: {
         
        }, //后台必须有key值20
        entEmail: "", //后台必须有key值14
        entRegFund:0, //后台必须有key值26
        entGroupName: "", //后台必须有key值17
        entBusinessSubordination: {}, //后台必须有key值5
        entSubordination: {}, //后台必须有key值28
        entEconomyTypeB: {}, //后台必须有key值12
        entEconomyTypeS: {}, //后台必须有key值13
        entIndustryRegulaB: {}, //后台必须有key值18
        entIndustryRegulaS: {}, //后台必须有key值19
        IndustryCategory: {}, //后台必须有key值33
        IndustryTypeM: {}, //后台必须有key值35
        IndustryTypeS: {}, //后台必须有key值36
        safetyProductionLicense: "", //后台必须有key值37
        annualSalesRevenue: "", //后台必须有key值1
        businessType: {}, //后台必须有key值2
        entSafeOrgEmpNum: 0,
        entScale: {}, //后台必须有key值27
        entBusinessLicense: [], //营业执照-- //后台必须有key值3
        entBusinessStatus: {}, //后台必须有key值4
        entHasParentCompany: {}, //后台必须有key值17
        entDivision: "null", //行政区域-- 后台必须有key值11


      },
    };
  },
  // props: {
  //   form: {
  //     type: Object,
  //     default: {},
  //   },
  // },
  mounted() {
    
  },
  // watch: {
  //   form: { // 监控该变量，重新赋值并刷新图表
  //     handler(newVal, oldVal) {
  //       this.form = newVal
  //       this.selectById()
  //     },
  //     deep: true // 必须设置
  //   }
  // },
  // async created() {
  //   await this.$parent.getTableData()
  //         this.selectById()
    // this.selectById()//加载回显三级级联

    // this.initLoadDict();
  // },
  watch: {
    form: { // 监控该变量，重新赋值并刷新图表
      handler(newVal, oldVal) {
        this.form = newVal
        this.selectById()//加载回显三级级联
        
      },
      deep: true // 必须设置
    },
    
  },
  created(){
    this.initLoadDict();//加载字典
  },
  beforeCreate() {},
  methods: {
    //是否为国有企业选中的事件
    radioE(val) {
      console.log('valR',val)
      this.form.entIsStateEnt= val;
      
    },
    //初始化加载字典
    initLoadDict() {
      fastGetDictAPI("ENT_BUSINESS").then((res) => {
        this.entBusiness = res.data;
      });
    },
    //表单提交事件
    onSubmit() {
      const params = this.form;
      // this.axios
      //   .post("/api/enterprise/info/create-base", this.form)
      //   .then((res) => {
      //     console.log(res);
      //   });
      enterpriseAPI(params).then((res) => {
        console.log(res.data);
      });
    },
    nextTo() {
      this.$parent.next();
    },
    updateProvince(data) {
      // console.log("data1", data);
    },
    //省市区三级联动事件
    handleChange(value) {
      // this.edit();
      // console.log(value)
      if (value[1] != null && value[2] != null) {
        var dz =
          CodeToText[value[0]] +
          "/" +
          CodeToText[value[1]] +
          "/" +
          CodeToText[value[2]];
      } else {
        if (value[1] != null) {
          dz = CodeToText[value[0]] + "/" + CodeToText[value[1]];
        } else {
          dz = CodeToText[value[0]];
        }
      }
      // console.log('dz',dz)
      // this.mtShopForm.address = dz;
      // console.log('this.selectedOptions',this.selectedOptions)

      this.form.entProvince = CodeToText[this.selectedOptions[0]];
      this.form.entCity = CodeToText[this.selectedOptions[1]];
      this.form.entCountry = CodeToText[this.selectedOptions[2]];
    },
    //地址的回显
    selectById() {
      var that = this;
      // let strings = that.mtShopForm.address.split("/");
      // that.form.entProvince = strings[0];
      // that.form.entCity = strings[1];
      // that.form.entCountry = strings[2];
      // console.log('TextToCode[that.form.entProvince].code,',TextToCode[that.form.entProvince].code)
      
      // console.log('[that.form.entProvince].code,',TextToCode[that.form.entProvince].code)
      console.log('this.form',this.form)
      // console.log('this.form.entProvince',this.form.entProvince)
      console.log('TextToCode[that.form.entProvince].code',TextToCode[that.form.entProvince].code)
        that.selectedOptions = [
          TextToCode[that.form.entProvince].code,
          TextToCode[that.form.entProvince][that.form.entCity].code,
          TextToCode[that.form.entProvince][that.form.entCity][that.form.entCountry].code,
        ];
      }
    },

    // 上传的版块
    handleEditChange(file, fileList) {
      let vm = this;
      vm.hideUploadEdit = fileList.length >= this.imgLimit;
    },
    handleRemove(file, fileList) {
      //移除图片
      console.log(file, fileList);
      this.editForm.uploadingurl = "";
      let vm = this;
      vm.hideUploadEdit = fileList.length >= this.imgLimit;
      this.$refs.upload.clearFiles();
    },
    handlePictureCardPreview(file) {
      //预览图片时调用
      console.log(file);
      this.editForm.uploadingurl = file.url;
      this.dialogVisible = true;
    },

    beforeAvatarUpload(file) {
      //文件上传之前调用做一些拦截限制
      console.log(file);
      const isJPG = file.type === "image/jpeg";
      const isLt2M = file.size / 1024 / 1024 < 2;

      if (!isJPG) {
        this.$message.error("上传广告图片只能是 JPG 格式!");
      }
      if (!isLt2M) {
        this.$message.error("上传图片大小不能超过 2MB!");
      }
      return isJPG && isLt2M;
    },
    handleAvatarSuccess(res, file) {
      //图片上传成功
      console.log(res);
      console.log(file);
      this.imageUrl = URL.createObjectURL(file.raw);
      this.editForm.uploadingurl = res.filePath;
    },
    handleExceed(files, fileList) {
      //图片上传超过数量限制
      this.$message.error("上传图片不能超过1张!");
      console.log(file, fileList);
    },
    imgUploadError(err, file, fileList) {
      //图片上传失败调用
      console.log(err);
      this.$message.error("上传图片失败!");
    },

    // 提交上传文件
    handleUploadPreview(params, value) {
      let formData = new FormData();
      formData.append("file", params.file);
      uploadAPI(formData).then((res) => {
        if (res.code == 200) {
          this.$set(this.form, value, res.data);
          this[value].push({
            name: res.data.originalFilename,
            url: res.data.url,
          });
          this.productImgs.push({
            name: res.data.originalFilename,
            url: res.data.url,
          });
        }
        this.imgSrc =
          "http://192.168.1.112:18000/resource/file/download/?url=" +
          this.productImgs[0].url;
        console.log("this[value]", this[value]);
        console.log("this.productImgs", this.productImgs);
        console.log("imgSrc", this.imgSrc);
      });
    },
    handleRemove(file, value) {
      this[value] = this[value].filter((item) => item.uid !== file.uid);
    },
    //所属行业大类选中事件
    getitem(val) {
      console.log("val值", val);
    },
    
    //经营状态选中事件
    entBS(val) {
      // console.log(val)
      this.form.entBusinessStatus = val;
    },
    //是否是母公司
    entHP(val) {
      this.form.entHasParentCompany = val;
    },
    //企业隶属关系选中事件
    entBSu(val) {
      // console.log(val)
      this.form.entBusinessSubordination = val;
    },
    //经济类型大类选中事件
    entET(val) {
      this.form.entEconomyTypeB = val;
    },
    //经济类型小类选中事件
    entETy(val) {
      this.form.entEconomyTypeS = val;
    },
    //行业监管大类选中事件
    entIR(val) {
      this.entIndustryRegulaB = val;
    },
    //行业监管小类选中事件
    entIRS(val) {
      this.form.entIndustryRegulaS = val;
    },
    //所属行业门类选中事件
    ICa(val) {
      this.form.IndustryCategory = val;
    },
    //所属行业中类选中事件
    ITy(val) {
      this.form.IndustryType = val;
    },
    //所属行业小类选中事件
    ITyS(val) {
      this.form.IndustryTypeS = val;
    },
    //企业类型/领证类型选中事件
    bsT(val) {
      this.form.businessType = val;
    },
    //企业规模选中事件
    eSca(val) {
      this.form.entScale = val;
    },

    //初始化加载字典
    initLoadDict() {
      fastGetDictAPI("SEX").then((res) => {//性别
         this.sexData = res.data
      });
      fastGetDictAPI("ENT_PERSON_TYPE").then((res) => {//人员类别
         this.optionsPersonnel = res.data
      });
       fastGetDictAPI("POLITICAL_OUTLOOK").then((res) => {//政治面貌
         this.political = res.data
      });
       fastGetDictAPI("MARITAL_STATUS").then((res) => {//婚姻状态
         this.marriage = res.data
      });
      fastGetDictAPI("HIGHEST_DEGREE").then((res) => {//最高学位
         this.degree = res.data
      });
      fastGetDictAPI("ENT_PERSON_CERT_TYPE").then((res) => {//证件类型
         this.certificate = res.data
      });  
      fastGetDictAPI("IS_PRACTICE_THREE").then((res) => {//证件类型
         this.chemical = res.data
      }); 
    },
  
};
</script>

<style lang="scss" scoped>
.title {
  display: flex;
  padding: 14px;
  border-bottom: 1px solid #d3d3d3;
  span {
    margin-left: 10px;
  }
}

.dataList {
  padding: 20px;
}

.middle {
  display: flex;
  justify-content: center;
}

/deep/ .el-upload--picture-card {
  background: white;
  border: 0px;
  width: 120px;
  height: 120px;
}
.avatar-uploader .el-upload {
  border: 1px dashed #d9d9d9;
  border-radius: 6px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}
.avatar-uploader .el-upload:hover {
  border-color: #409eff;
}
.avatar-uploader-icon {
  font-size: 28px;
  color: #8c939d;
  width: 178px;
  height: 178px;
  line-height: 178px;
  text-align: center;
}
/deep/ .el-upload-list--picture-card .el-upload-list__item {
  width: 120px;
  height: 120px;
}
.avatar {
  width: 120px;
  height: 120px;
  display: block;
}
</style>